import 'package:flutter_test/flutter_test.dart';
import 'package:lib_common/utils/time_utils.dart';

void main() {
  group("测试时间转换", () {
    test("时间戳转时间字符串", () {
      int time = 1;
      String result = TimeUtils.getFormatFromTime(time,dateFormat: TimeUtils.yyyyMmDdHhMmSs);
      expect(result, "1970-01-01 08:00:00");
    });
    test("时间字符串转时间戳", () {
      String date = "20120227";
      int result = TimeUtils.getTimeFromFormat(date);
      expect(result, 0);
    });
  });
}
